const path = require('path');
const webpack = require('webpack');

module.exports = {
    entry: {
        '@angular': ['reflect-metadata', 'zone.js'],
        'app': './app/renderer.ts'
    },
    output: {
        path: path.resolve(__dirname, 'app/build'),
        filename: '[name].js'
    },
    module: {
        rules: [
            {
                test: /\.ts/,
                loaders: [
                    {
                        loader: 'awesome-typescript-loader',
                        options: { configFileName: path.resolve(__dirname, 'app/tsconfig.json') }
                    }
                ]
            },
            {
                test: /\.html$/,
                loader: 'html-loader'
            }
        ]
    },
    resolve: {
        extensions: ['.ts', '.js', '.html']
    },
    plugins: [
        new webpack.ContextReplacementPlugin(
            /angular(\\|\/)core(\\|\/)@angular/,
            path.resolve(__dirname, 'app'),
            {}
        )
    ],
    target:'electron-renderer'
};
